import 'package:flutter_test/flutter_test.dart';
import 'package:component_public_dialog/component_public_dialog.dart';
import 'package:component_public_dialog/component_public_dialog_platform_interface.dart';
import 'package:component_public_dialog/component_public_dialog_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockComponentPublicDialogPlatform
    with MockPlatformInterfaceMixin
    implements ComponentPublicDialogPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ComponentPublicDialogPlatform initialPlatform = ComponentPublicDialogPlatform.instance;

  test('$MethodChannelComponentPublicDialog is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelComponentPublicDialog>());
  });

  test('getPlatformVersion', () async {
    ComponentPublicDialog componentPublicDialogPlugin = ComponentPublicDialog();
    MockComponentPublicDialogPlatform fakePlatform = MockComponentPublicDialogPlatform();
    ComponentPublicDialogPlatform.instance = fakePlatform;

    expect(await componentPublicDialogPlugin.getPlatformVersion(), '42');
  });
}
